using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Vin.Extension.Framework.AntChain.Options;
using Vin.Tool.AspNetCore.Singleton;
using Vin.Tool.Core.AssertCategory;

namespace Vin.Extension.Framework.AntChain;

public class ExtensionEntry : IVinExtension
{
    public void AddVinExtension(WebApplicationBuilder builder)
    {
    }

    public void AddVinExtension(IServiceCollection services)
    {
    }

    public void UseVinExtension(WebApplication app)
    {
        var option = VinApp.GetConfig<VinAntChainConfig>();
        if (option.NotifyUrl.IsNotNullOrWhiteSpace() && option.NotifyUrl!.StartsWith("/")) AntChainEndpoint.UseAntChainNotify(app, option.NotifyUrl!);
    }
}